#include <iostream>
using namespace std;
class Person
{

public:
    int age;
    string name;

    Person(int age, string name) : name(name), age(age)
    {
        cout << "构造方法执行了" << endl;
    }

    Person(const Person &p)
    {
        cout << "拷贝构造函数成功了" << endl;
        name = p.name;
        age = p.age;
    }
};

int main(int argc, char const *argv[])
{
    Person p1(13, "小明");

    Person p2(p1);

    cout << &p1 << endl;
    cout << &p2 << endl;

    cout << &p1.age << endl;
    cout << &p2.age << endl;
    cout << &p2.name << endl;

    cout << p1.age << "\t" << p1.name << endl;
    cout << p2.age << "\t" << p2.name << endl;

    return 0;
}
